namespace Dida
{
	[Dxml.DidaObject(TagName = "SimpleTransform")]
	public class SimpleTransformObj : IAniValue<SimpleTransform>
	{
		SimpleTransform curVal;

		public AniSocket<Vector3D> pos;
		public AniSocket<Quaternion> rot;

		[Dxml.AutoXmlConstructor]
		public SimpleTransformObj(AniSocket<Vector3D> pos,
			AniSocket<Quaternion> rot)
		{
			this.pos = pos;
			this.rot = rot;
		}

		public SimpleTransform CurrentValue
		{
			get { return curVal; }
		}

		public void Start()
		{
			Update(0);
		}

		public void Update(float timeDelta)
		{
			curVal = new SimpleTransform(pos.Value, rot.Value);
		}
	}

	[Dxml.DidaObject]
	public class ChildSimpleTransform : IAniValue<SimpleTransform>
	{
		SimpleTransform curVal;

		public AniSocket<SimpleTransform> parent;
		public AniSocket<Vector3D> pos;
		public AniSocket<Quaternion> rot;

		[Dxml.AutoXmlConstructor]
		public ChildSimpleTransform(AniSocket<SimpleTransform> parent,
			AniSocket<Vector3D> pos,AniSocket<Quaternion> rot)
		{
			this.parent = parent;
			this.pos = pos;
			this.rot = rot;
		}

		public SimpleTransform CurrentValue
		{
			get { return curVal; }
		}

		public void Start()
		{
			Update(0);
		}

		public void Update(float timeDelta)
		{
			curVal = parent.Value;
			curVal.Combine(new SimpleTransform(pos.Value, rot.Value));
		}
	}
}
